<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTestingItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('testing_item', function (Blueprint $table) {
            $table->increments('id');
            $table->Integer('testing_id')->index()->comment('题目名称');
            $table->string('title',200)->nullable()->comment('题目名称');
            $table->enum('question_type',[1,2,3,4,5,6])->default(1)->comment('1单选，2多选，3填空，4关联计算，5自动计算，6动态多选');
            $table->enum('middle_var',[1,0])->default(0)->comment('是否有中间值');
            $table->string('index',10)->index()->comment('题目编号');
            $table->string('options',400)->nullable()->comment('题目选项');
            $table->string('expression',400)->nullable()->comment('关联表达式');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('testing_item');
    }
}
